package cn.hanyx.coder.design.pattern.behavioral.state.demo01;

/**
 * ApplicationDemo
 *
 * @author hanyx
 * @date 2020/06/08
 */
public class ApplicationDemo {
    public static void main(String[] args) {
        MarioStateMachine mario = new MarioStateMachine();
        mario.obtainMushRoom();
        mario.obtainFireFlower();
        mario.meetMonster();
        int score = mario.getScore();
        State state = mario.getCurrentState();
        System.out.println("mario score: " + score + "; state: " + state);
        if (state.getValue() == 4) {
            System.out.println("mario game end");
        }
    }
}
